package cases.boxes 
{
	import org.despair2D.ui.events.ManipulateEvent;
	import org.despair2D.ui.LabelButton;
	import org.despair2D.ui.Persona;
	import org.despair2D.ui.PersonaState;
		import cases.boxes.*;
	//import com.sociodox.theminer.TheMiner;
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.DisplayObject;
	import flash.display.Shape;
	import flash.display.Sprite;
	import flash.filters.BlurFilter;
	import flash.geom.Matrix;
	import flash.geom.Point;
	import flash.ui.Mouse;
	import flash.ui.MouseCursorData;
	import org.despair2D.ui.PersonaState;
	import org.despair2D.Despair;
	import org.despair2D.ui.Button;
	import org.despair2D.ui.CheckBox;
	import org.despair2D.ui.DespairUI;
	import org.despair2D.ui.events.SelectedEvent;
	import org.despair2D.ui.events.ManipulateEvent;
	import org.despair2D.ui.LabelButton;
	import resource.Assets;
	import resource.AssetsUI;
	/**
	 * ...
	 * @author ...
	 */
	public class StartingState extends PersonaState 
	{
		
		public function StartingState() 
		{
			
		}
		
		
		override public function enter():void
		{
		
			
			var lb:LabelButton
			
			lb = new LabelButton('Btn_A', 'BDemo');
			this.group.addFusion(lb)
			lb.addEventListener(ManipulateEvent.CLICK, function(e:ManipulateEvent):void { toggle(BDemoBox) } )
			lb.y = 160
			
			lb = new LabelButton('Btn_A', 'AnimeTest');
			this.group.addFusion(lb)
			lb.addEventListener(ManipulateEvent.CLICK, function(e:ManipulateEvent):void { toggle(AnimeTestBox) } )
			lb.y = 210
			
			lb = new LabelButton('Btn_A', 'ImagePuppet');
			this.group.addFusion(lb)
			lb.addEventListener(ManipulateEvent.CLICK,function(e:ManipulateEvent):void{ toggle(ImagePuppetDemo)})
			lb.y = 310
			
			lb = new LabelButton('Btn_A', 'Range');
			this.group.addFusion(lb)
			lb.addEventListener(ManipulateEvent.CLICK,function(e:ManipulateEvent):void{ toggle(RangeState)})
			lb.y = 360
		}
		
		public function toggle(stateData:Class):void
		{
			var PA:Persona = DespairUI.retrievePersona(stateData)
			if (PA)
			{
				PA.kill()
			}
			
			else
			{
				DespairUI.createPersona(stateData)
			}
		}

	}

}